﻿<!--#include file="utf-8.asp"-->
<!--#include file="conn.asp"-->
<!--#include file="seeion.asp"-->
<!--#include file="page.asp"-->
<%
request_from=request("from")
request_to=request("to")
if request_from="" then
request_from=date
end if
if request_to="" then
request_to=date & " 23:59:59"
else
	if len(request_to)<11 then
	request_to=request_to & " 23:59:59"
	end if
end if
'response.write (request_Date)
'response.end
%>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>列表管理</title>
<link href="images/style.css" type="text/css" rel="stylesheet" />
<script src="WdatePicker.js" language="javascript"></script>
<script>
function changeShowDate(){
var f = new Date(document.getElementById('from').value.replace(/\-/g, "\/"));
var t = new Date(document.getElementById('to').value.replace(/\-/g, "\/"));        
if(f > t) {
	alert("结束日期不能小于开始日期！");
    return false;
} 
var f1 = document.getElementById('from').value;
var t1 = document.getElementById('to').value;

window.location.href="/admin/admin_Traffic_Stat_Time.asp?from="+f1+"&to="+t1;
}
function changeShowProvince(){
var c = document.getElementById("sel_Province").value;
window.location.href="/admin/admin_Traffic_Stat_Province.asp?Province="+c;
}
</script>

</head>
<body>
<table width="95%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#CCCCCC">
<tr style="display:none;">
<td height="30" colspan="2" bgcolor="#ffffff">统计时间：
<%
if request_from=request_to then
response.write (request_from)
else
response.write (request_from) & " 到 " & (request_to) 
end if
%>　
共：
<%	
set rs=server.createobject("adodb.recordset") 
if request_from=request_to then
exec="select * from Traffic_Stat where datetime=#"&request_from&"# order by id desc" 
else
exec="select * from Traffic_Stat where datetime>=#"&request_from&"# and datetime<=#"&request_to&"# order by id desc" 
end if
rs.open exec,conn,1,1 
dim Num
Num=0
do while not rs.eof 
Num=Num+1
rs.movenext
loop
rs.close
set rs = nothing
response.write (Num)
%> 
人访问</td>
</tr>
<tr>
<td height="30" colspan="2" bgcolor="#ffffff">
开始日期：
<input name="from" type="text" onClick="WdatePicker()" size="15" value="<%=request_from%>">
<label>
　结束日期：
<input name="to" type="text" onClick="WdatePicker()" value="" size="15"/>
　
<input type="submit" onClick="changeShowDate()" name="button3" id="button3" value="查询">
</label></td>
</tr>
<tr>
<td colspan="2" bgcolor="#FFFFFF">
<p>
<%	
set rs=server.createobject("adodb.recordset") 
if request_from=request_to then
exec="select * from Traffic_Stat where datetime=#"&request_from&"# order by id desc" 
else
exec="select * from Traffic_Stat where datetime>=#"&request_from&"# and datetime<=#"&request_to&"# order by id desc" 
end if
'response.write (exec)
rs.open exec,conn,1,1 
if rs.eof then
response.Write "&nbsp;暂无数据！"
response.end
else
rs.PageSize =10 '每页记录条数
iCount=rs.RecordCount '记录总数
iPageSize=rs.PageSize
maxpage=rs.PageCount 
page=request("page")
if Not IsNumeric(page) or page="" then
page=1
else
page=cint(page)
end if
if page<1 then
page=1
elseif  page>maxpage then
page=maxpage
end if
rs.AbsolutePage=Page
if page=maxpage then
x=iCount-(maxpage-1)*iPageSize
else
x=iPageSize
end if	
%>
<%For i=1 To x%>
</p>
<table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="cedced" style="font-family : sans-serif;">
  <tr>
    <td width="20%" height="25" bgcolor="e9f1fa"><strong>时间：</strong><span class="Traffic_Stat_blue1"><%=rs("datetime")%></span></td>
    <td width="20%" height="25" bgcolor="e9f1fa">IP：<span class="Traffic_Stat_blue1"><%=rs("ip")%></span></td>
    <td width="35%" height="25" bgcolor="e9f1fa"><strong>地区：</strong><span class="Traffic_Stat_blue1"><%=rs("Province")%> - <%=rs("City")%></span></td>
    <td width="5%" height="25" align="center" bgcolor="e9f1fa"><a href="javascript:if(confirm('确定要删除该条记录吗?')){window.location.href='admin_Traffic_stat_delete.asp?t=line&id=<%=rs("id")%>';}else{}">删除</a></td>
  </tr>
  <tr>
    <td height="25" colspan="2"><strong>来路：</strong><%=rs("Referer")%></td>
    <td height="25" colspan="2"><strong>受访：</strong><%=rs("page")%> (
      <%
dim Num2,rs2,exec2
Num2=0
set rs2=server.createobject("adodb.recordset") 
exec2="select * from Traffic_Stat where datetime like '%"&request_Date&"%' and page='"&rs("page")&"' order by id desc" 
rs2.open exec2,conn,1,1 
do while not rs2.eof 
Num2=Num2+1
rs2.movenext
loop
rs2.close
set rs2 = nothing
response.write (Num2)
%>
      )</td>
  </tr>
</table>
<%rs.movenext
next
%>
<%
end if
%></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><%'以下显示分页
call PageControl(iCount,maxpage,page,"border=0 align=center","<p align=center>")
rs.close
set rs=nothing
%></td>
<td bgcolor="#FFFFFF">&nbsp;</td>
</tr>
<tr>
  <td colspan="2" bgcolor="#FFFFFF"><p>
<%
dim Time1,Time2,Time3,Time4,Time5,Time6,Time7,Time8,Time9,Time10,Time11,Time12,Time13
Time1=0:Time2=0:Time3=0:Time4=0:Time5=0:Time6=0:Time7=0:Time8=0:Time9=0:Time10=0:Time11=0:Time12=0:Time13=0
set rs=server.createobject("adodb.recordset") 
exec="select * from Traffic_Stat where datetime like '%"&date&"%' order by id desc" 
'response.write (exec)
'response.end
rs.open exec,conn,1,1
if rs.eof or rs.bof then
response.write "没有数据！"

end if 
do while not rs.eof
dim hours
hours = hour(rs("datetime"))
select case hours
case 0,1
Time1=Time1+1				
case 2,3
Time2=Time2+1								
case 4,5
Time3=Time3+1									
case 6,7
Time4=Time4+1									
case 8,9
Time5=Time5+1			
case 10,11
Time6=Time6+1									
case 12,13
Time7=Time7+1								
case 14,15
Time8=Time8+1								
case 16,17
Time9=Time9+1							
case 18,19
Time10=Time10+1									
case 20,21
Time11=Time11+1									
case 22,23
Time12=Time12+1					
end select			
'response.write (hours) & "<br>"
Num=Num+1
rs.movenext
loop
rs.close
set rs = nothing
'response.end
%>
  </p>
    <table border="1" cellpadding="0" cellspacing="0" bordercolor="cedced">
      <tr bgcolor="e9f1fa">
        <td height="25" style="padding-top:3px;"><strong>　今日受访时段分析</strong></td>
      </tr>
      <tr>
        <td height="135" colspan="3" valign="top" bgcolor="#FFFFFF"><table height="200" border="0" cellpadding="0" cellspacing="0" >
            <tr>
              <td width="30" height="175" valign="bottom" background="images/pv_bg.jpg"></td>
              <td align="center" valign="bottom" class="Traffic_Stat_form"><%=Formatnumber((time1/Num)*100,1)%>%<br>
                  <img src="images/pv_bar.jpg" width="16" height=<%=int((time1/Num)*100)%>></td>
              <td align="center" valign="bottom" class="Traffic_Stat_form"><%=Formatnumber((time2/Num)*100,1)%>%<br>
                  <img src="images/pv_bar.jpg" width="16" height=<%=int((time2/Num)*100)%>></td>
              <td align="center" valign="bottom" class="Traffic_Stat_form"><%=Formatnumber((time3/Num)*100,1)%>%<br>
                  <img src="images/pv_bar.jpg" width="16" height=<%=int((time3/Num)*100)%>></td>
              <td align="center" valign="bottom" class="Traffic_Stat_form"><%=Formatnumber((time4/Num)*100,1)%>%<br>
                  <img src="images/pv_bar.jpg" width="16" height=<%=int((time4/Num)*100)%>></td>
              <td width="60" align="center" valign="bottom" class="Traffic_Stat_form"><%=Formatnumber((time5/Num)*100,1)%>%<br>
                  <img src="images/pv_bar.jpg" width="16" height=<%=int((time5/Num)*100)%>></td>
              <td align="center" valign="bottom" class="Traffic_Stat_form"><%=Formatnumber((time6/Num)*100,1)%>%<br>
                  <img src="images/pv_bar.jpg" width="16" height=<%=int((time6/Num)*100)%>></td>
              <td align="center" valign="bottom" class="Traffic_Stat_form"><%=Formatnumber((time7/Num)*100,1)%>%<br>
                  <img src="images/pv_bar.jpg" width="16" height=<%=int((time7/Num)*100)%>></td>
              <td align="center" valign="bottom" class="Traffic_Stat_form"><%=Formatnumber((time8/Num)*100,1)%>%<br>
                  <img src="images/pv_bar.jpg" width="16" height=<%=int((time8/Num)*100)%>></td>
              <td align="center" valign="bottom" class="Traffic_Stat_form"><%=Formatnumber((time9/Num)*100,1)%>%<br>
                  <img src="images/pv_bar.jpg" width="16" height=<%=int((time9/Num)*100)%>></td>
              <td align="center" valign="bottom" class="Traffic_Stat_form"><%=Formatnumber((time10/Num)*100,1)%>%<br>
                  <img src="images/pv_bar.jpg" width="16" height=<%=int((time10/Num)*100)%>></td>
              <td align="center" valign="bottom" class="Traffic_Stat_form"><%=Formatnumber((time11/Num)*100,1)%>%<br>
                  <img src="images/pv_bar.jpg" width="16" height=<%=int((time11/Num)*100)%>></td>
              <td align="center" valign="bottom" class="Traffic_Stat_form"><%=Formatnumber((time12/Num)*100,1)%>%<br>
                  <img src="images/pv_bar.jpg" width="16" height=<%=int((time12/Num)*100)%>></td>
            </tr>
            <tr>
              <td width="30" height="30"></td>
              <td height="30" align="center" class="Traffic_Stat_form">0:00</td>
              <td height="30" align="center" class="Traffic_Stat_form">2:00</td>
              <td height="30" align="center" class="Traffic_Stat_form">4:00</td>
              <td height="30" align="center" class="Traffic_Stat_form">6:00</td>
              <td width="60" height="30" align="center" class="Traffic_Stat_form">8:00</td>
              <td height="30" align="center" class="Traffic_Stat_form">10:00</td>
              <td height="30" align="center" class="Traffic_Stat_form">12:00</td>
              <td height="30" align="center" class="Traffic_Stat_form">14:00</td>
              <td height="30" align="center" class="Traffic_Stat_form">16:00</td>
              <td height="30" align="center" class="Traffic_Stat_form">18:00</td>
              <td height="30" align="center" class="Traffic_Stat_form">20:00</td>
              <td height="30" align="center" class="Traffic_Stat_form">22:00</td>
            </tr>
        </table></td>
      </tr>
    </table></td>
</tr>
</table>
</body>
</html>
<% 
if Request.QueryString("xiugaipx")="ok" then
id=request("id") 
sql="select * from about where id="&id 
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
IF not isNumeric(request("px_id")) then
response.write("<script>alert(""排序ID必须为数字！""); history.go(-1);</script>")
response.end
end if
rs("px_id")=request.form("px_id") 
rs.update 
rs.close 
response.Write("<script language=""javascript"">alert(""修改排序成功！"");window.location.href='Manage_About.asp';</script>")
end if
%> 
<%
if request("act")="del" then
id=request("id")
if id="" then
Response.Write "<script language='javascript'>alert('参数错误!');document.location.href('Manage_About.asp');</script>"
Response.End()
end if
set rs=server.createobject("adodb.recordset")
rs.open "Select * from about where id="&Request("id"),conn,1,3
if rs.bof and rs.eof then
Response.Write "<script language='javascript'>alert('数据库中没有该记录！');document.location.href('Manage_About.asp');</script>"
Response.End()
else
rs.Delete
rs.Update
Response.Write "<script language='javascript'>alert('成功删除指定的信息！');document.location.href('Manage_About.asp');</script>"
end if
end if
%>
